var API_URL = 'http://123.57.41.120/newchinalifecard/';
//var API_URL = 'http://localhost:8080/newchinalifecard/';
var openid = getQueryString("openid");
var origopenid = getQueryString("origopenid"); //代理人openid
var lastopenid = getQueryString("lastopenid"); //分享人openid
// var openid = 1;


/**
 * 获取地址栏的值
 * @param param
 * @returns {*}
 */
function getQueryString(name) {
	var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
	var r = window.location.search.substr(1).match(reg);
	if (r != null) return unescape(r[2]); return null;
}

/**
 * 格式化时间
 * @param format
 * @returns {*}
 */
Date.prototype.format =function(format)
{
	var o = {
		"M+" : this.getMonth()+1, //month
		"d+" : this.getDate(), //day
		"h+" : this.getHours(), //hour
		"m+" : this.getMinutes(), //minute
		"s+" : this.getSeconds() //second
	};
	if(/(y+)/.test(format)){
		format=format.replace(RegExp.$1,(this.getFullYear()+"").substr(4- RegExp.$1.length));

	}
	for(var k in o){
		if(new RegExp("("+ k +")").test(format)){
		format = format.replace(RegExp.$1,RegExp.$1.length==1? o[k] : ("00"+ o[k]).substr((""+ o[k]).length));
		}
	}
	return format;
};